package com.heima.model.search.pojos;


import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

/**
 * ES的索引库映射对象
 */
@Data
@Document(indexName = "article")  //映射索引库
public class ArticleDocument {

    @Id   //把id值作为文档的主键
    private Long id;

    @Field(type = FieldType.Text,analyzer = "ik_max_word")  // 指定字段类型及分词器
    private String title;

    private Integer authorId;

    private String authorName;

    private Integer channelId;

    private String channelName;

    private Integer layout;

    private String images;

    private Integer likes;

    private Integer collection;

    private Integer comment;

    private Integer views;

    private Date createdTime;

    private Date publishTime;

    private String staticUrl;
}
